import http from "@/api";
import { ResPage } from "@/api/interface/index";
import { Applet } from "@/api/interface/iot";

export const getShowAppletList = (params: Applet.ReqUserApplet) => {
	return http.get<ResPage<Applet.ReqUserApplet[]>>(`/service/app/show/find`, params);
};
export const getMarketAppletList = (params: Applet.ReqUserApplet) => {
	return http.get<ResPage<Applet.ReqUserApplet[]>>(`/service/app/market/find`, params);
};
export const getUserAppletList = (params: Applet.ReqUserApplet) => {
	return http.get<ResPage<Applet.ReqUserApplet[]>>(`/service/app/find`, params);
};
export const getUserAppletDetail = (params: Applet.ReqUserApplet) => {
	return http.get<Applet.ReqUserApplet>(`/service/app/get`, params);
};
export const addUserApplet = (params: Applet.ResUserApplet) => {
	return http.post(`/service/app/add`, params);
};
export const delUserApplet = (params: Applet.ResUserApplet) => {
	return http.post(`/service/app/remove`, params);
};
export const modUserApplet = (params: Applet.ResUserApplet) => {
	return http.post(`/service/app/modify`, params);
};
export const findAppletInstanceList = (params: Applet.ResUserApplet) => {
	return http.get<any>(`/service/app/instance/find`, params);
};
export const modAppletInstance = (params: Applet.ReqApplet) => {
	return http.post(`/service/app/instance/modify`, params);
};
export const delAppletInstance = (params: Applet.ReqApplet) => {
	return http.post(`/service/app/instance/remove`, params);
};
export const addAppletInstance = (params: Applet.ReqApplet) => {
	return http.post(`/service/app/instance/add`, params);
};
export const getAppletInstance = (params: Applet.ReqApplet) => {
	return http.get<any>(`/service/app/instance/get`, params);
};
export const marketPublish = (params: Applet.ReqApplet) => {
	return http.post<any>(`/service/app/market/publish`, params);
};
export const marketWithdraw = (params: Applet.ReqApplet) => {
	return http.post<any>(`/service/app/market/withdraw`, params);
};
export const marketInstall = (params: Applet.ReqApplet) => {
	return http.post<any>(`/service/app/market/install`, params);
};
export const upgradeInstance = (params: Applet.ReqApplet) => {
	return http.post<any>(`/service/app/instance/upgrade`, params);
};
